<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Version Information</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="prev" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="next" href="glib-Basic-Types.html" title="Basic Types">
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="glib.html" title="GLib Overview">
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
<link rel="chapter" href="glib-core.html" title="GLib Core Application Support">
<link rel="chapter" href="glib-utilities.html" title="GLib Utilities">
<link rel="chapter" href="glib-data-types.html" title="GLib Data Types">
<link rel="chapter" href="tools.html" title="GLib Tools">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
<link rel="index" href="ix10.html" title="Index of new symbols in 2.16">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="glib-fundamentals.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib-fundamentals.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-Basic-Types.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2878104" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id2878806" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="glib-Version-Information"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2878104"></a><span class="refentrytitle">Version Information</span>
</h2>
<p>Version Information &#8212; Variables and functions to check the GLib version</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;glib.h&gt;


extern              const guint <a class="link" href="glib-Version-Information.html#glib-major-version">glib_major_version</a>;
extern              const guint <a class="link" href="glib-Version-Information.html#glib-minor-version">glib_minor_version</a>;
extern              const guint <a class="link" href="glib-Version-Information.html#glib-micro-version">glib_micro_version</a>;
extern              const guint <a class="link" href="glib-Version-Information.html#glib-binary-age">glib_binary_age</a>;
extern              const guint <a class="link" href="glib-Version-Information.html#glib-interface-age">glib_interface_age</a>;
const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*        <a class="link" href="glib-Version-Information.html#glib-check-version">glib_check_version</a>                  (<a class="link" href="glib-Basic-Types.html#guint">guint</a> required_major,
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> required_minor,
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> required_micro);

#define             <a class="link" href="glib-Version-Information.html#GLIB-MAJOR-VERSION:CAPS">GLIB_MAJOR_VERSION</a>
#define             <a class="link" href="glib-Version-Information.html#GLIB-MINOR-VERSION:CAPS">GLIB_MINOR_VERSION</a>
#define             <a class="link" href="glib-Version-Information.html#GLIB-MICRO-VERSION:CAPS">GLIB_MICRO_VERSION</a>
#define             <a class="link" href="glib-Version-Information.html#GLIB-CHECK-VERSION:CAPS">GLIB_CHECK_VERSION</a>                  (major,minor,micro)
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2878806"></a><h2>Description</h2>
<p>
GLib provides version information, primarily useful in configure checks
for builds that have a configure script. Applications will not
typically use the features described here.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2878822"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2878832"></a><h3>
<a name="glib-major-version"></a>glib_major_version</h3>
<a class="indexterm" name="id2878842"></a><pre class="programlisting">extern const guint glib_major_version;
</pre>
<p>
The major version number of the GLib library. 
(e.g. in GLib version 1.2.5 this is 1.)
</p>
<p>
This variable is in the library, so represents the
GLib library you have linked against. Contrast with the
<a class="link" href="glib-Version-Information.html#GLIB-MAJOR-VERSION:CAPS"><span class="type">GLIB_MAJOR_VERSION</span></a> macro, which represents the major version of the
GLib headers you have included.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2878871"></a><h3>
<a name="glib-minor-version"></a>glib_minor_version</h3>
<a class="indexterm" name="id2878881"></a><pre class="programlisting">extern const guint glib_minor_version;
</pre>
<p>
The minor version number of the GLib library.
(e.g. in GLib version 1.2.5 this is 2.)
</p>
<p>
This variable is in the library, so represents the
GLib library you have linked against. Contrast with the
<a class="link" href="glib-Version-Information.html#GLIB-MINOR-VERSION:CAPS"><span class="type">GLIB_MINOR_VERSION</span></a> macro, which represents the minor version of the
GLib headers you have included.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2878910"></a><h3>
<a name="glib-micro-version"></a>glib_micro_version</h3>
<a class="indexterm" name="id2878921"></a><pre class="programlisting">extern const guint glib_micro_version;
</pre>
<p>
The micro version number of the GLib library.
(e.g. in GLib version 1.2.5 this is 5.)
</p>
<p>
This variable is in the library, so represents the GLib library you
have linked against. Contrast with the <a class="link" href="glib-Version-Information.html#GLIB-MICRO-VERSION:CAPS"><span class="type">GLIB_MICRO_VERSION</span></a> macro, which
represents the micro version of the GLib headers you have included.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2878950"></a><h3>
<a name="glib-binary-age"></a>glib_binary_age</h3>
<a class="indexterm" name="id2878960"></a><pre class="programlisting">extern const guint glib_binary_age;
</pre>
<p>
This is the binary age passed to <span class="application">libtool</span>. If 
<span class="application">libtool</span> means nothing to you, don't worry 
about it. ;-)
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2878986"></a><h3>
<a name="glib-interface-age"></a>glib_interface_age</h3>
<a class="indexterm" name="id2878997"></a><pre class="programlisting">extern const guint glib_interface_age;
</pre>
<p>
This is the interface age passed to <span class="application">libtool</span>. If 
<span class="application">libtool</span> means nothing to you, don't worry 
about it. ;-)
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2879023"></a><h3>
<a name="glib-check-version"></a>glib_check_version ()</h3>
<a class="indexterm" name="id2879036"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*        glib_check_version                  (<a class="link" href="glib-Basic-Types.html#guint">guint</a> required_major,
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> required_minor,
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> required_micro);</pre>
<p>
Checks that the GLib library in use is compatible with the
given version. Generally you would pass in the constants
<a class="link" href="glib-Version-Information.html#GLIB-MAJOR-VERSION:CAPS"><span class="type">GLIB_MAJOR_VERSION</span></a>, <a class="link" href="glib-Version-Information.html#GLIB-MINOR-VERSION:CAPS"><span class="type">GLIB_MINOR_VERSION</span></a>, <a class="link" href="glib-Version-Information.html#GLIB-MICRO-VERSION:CAPS"><span class="type">GLIB_MICRO_VERSION</span></a>
as the three arguments to this function; that produces
a check that the library in use is compatible with
the version of GLib the application or module was compiled
against.
</p>
<p>
Compatibility is defined by two things: first the version
of the running library is newer than the version
<em class="parameter"><code>required_major.required_minor</code></em>.<em class="parameter"><code>required_micro</code></em>. Second
the running library must be binary compatible with the
version <em class="parameter"><code>required_major.required_minor</code></em>.<em class="parameter"><code>required_micro</code></em>
(same major version.)</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>required_major</code></em>&#160;:</span></p></td>
<td> the required major version.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>required_minor</code></em>&#160;:</span></p></td>
<td> the required minor version.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>required_micro</code></em>&#160;:</span></p></td>
<td> the required micro version.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the GLib library is compatible with the
  given version, or a string describing the version mismatch.
  The returned string is owned by GLib and must not be modified
  or freed.

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since  2.6
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2879208"></a><h3>
<a name="GLIB-MAJOR-VERSION:CAPS"></a>GLIB_MAJOR_VERSION</h3>
<a class="indexterm" name="id2879220"></a><pre class="programlisting">#define GLIB_MAJOR_VERSION 2
</pre>
<p>
The major version number of the GLib library.
Like <a class="link" href="glib-Version-Information.html#glib-major-version"><span class="type">glib_major_version</span></a>, but from the headers used at
application compile time, rather than from the library linked against
at application run time.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2879246"></a><h3>
<a name="GLIB-MINOR-VERSION:CAPS"></a>GLIB_MINOR_VERSION</h3>
<a class="indexterm" name="id2879257"></a><pre class="programlisting">#define GLIB_MINOR_VERSION 16
</pre>
<p>
The minor version number of the GLib library.
Like <a
href="/usr/share/gtk-doc/html/gtk/gtk-Feature-Test-Macros.html#gtk-minor-version"
><span class="type">gtk_minor_version</span></a>, but from the headers used at
application compile time, rather than from the library linked against
at application run time.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2879285"></a><h3>
<a name="GLIB-MICRO-VERSION:CAPS"></a>GLIB_MICRO_VERSION</h3>
<a class="indexterm" name="id2879296"></a><pre class="programlisting">#define GLIB_MICRO_VERSION 3
</pre>
<p>
The micro version number of the GLib library.
Like <a
href="/usr/share/gtk-doc/html/gtk/gtk-Feature-Test-Macros.html#gtk-micro-version"
><span class="type">gtk_micro_version</span></a>, but from the headers used at
application compile time, rather than from the library linked against
at application run time.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2879324"></a><h3>
<a name="GLIB-CHECK-VERSION:CAPS"></a>GLIB_CHECK_VERSION()</h3>
<a class="indexterm" name="id2879335"></a><pre class="programlisting">#define             GLIB_CHECK_VERSION(major,minor,micro)</pre>
<p>
Checks the version of the GLib library.
Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the version of the GLib header files is the same 
as or newer than the passed-in version.

</p>
<div class="example">
<a name="id2879358"></a><p class="title"><b>Example&#160;1.&#160;Checking the version of the GLib library</b></p>
<div class="example-contents"><pre class="programlisting">
  if (!GLIB_CHECK_VERSION (1, 2, 0))
    g_error ("GLib version 1.2.0 or above is needed");
</pre></div>
</div>
<p><br class="example-break">
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>major</code></em>&#160;:</span></p></td>
<td>the major version number.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>minor</code></em>&#160;:</span></p></td>
<td>the minor version number.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>micro</code></em>&#160;:</span></p></td>
<td>the micro version number.


</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id2879417"></a><div class="refsect2" lang="en"><a name="id2879418"></a></div>
<hr>
<div class="refsect2" lang="en"><a name="id2879419"></a></div>
</div>
</div>
</body>
</html>
